import request from '@/utils/request';
import {AxiosPromise} from 'axios';
import {ProductionOrderForm, ProductionOrderList} from '@/api/productionOrder/types';

/**
 * 查询H5生产工单列表
 * @param query
 * @returns {*}
 */

export const getProductionOrder = (query?: ProductionOrderForm): AxiosPromise<ProductionOrderList[]> => {
  return request({
    url: '/painting/sapOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 开工
 * @param data
 */

export const startWork = (data?: ProductionOrderForm) => {
  return request({
    url: '/painting/sapOrder/list',
    method: 'post',
    data
  });
};


/**
 * 异常上报
 * @param data
 */

export const AbnormalReporting = (data?: ProductionOrderForm) => {
  return request({
    url: '/painting/sapOrder/list',
    method: 'post',
    data
  });
};